#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Element.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class ParameterableElement;
class TemplateBinding;
class TemplateParameter;

/// <summary>
/// TemplateParameterSubstitution
/// A TemplateParameterSubstitution relates the actual parameter to a formal
/// TemplateParameter as part of a template binding.
/// </summary>
class UMLMODEL_EXPORT TemplateParameterSubstitution : public Element {

public: // Constructors and destructors
    explicit TemplateParameterSubstitution(const QString& umlType="uml::TemplateParameterSubstitution");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// actual getter
    /// The ParameterableElement that is the actual parameter for this
    /// TemplateParameterSubstitution.
    /// </summary>
    shared_ptr<ParameterableElement> actual() const;

    /// <summary>
    /// actual setter
    /// The ParameterableElement that is the actual parameter for this
    /// TemplateParameterSubstitution.
    /// </summary>
    void setActual(shared_ptr<ParameterableElement> value);

    /// <summary>
    /// formal getter
    /// The formal TemplateParameter that is associated with this
    /// TemplateParameterSubstitution.
    /// </summary>
    shared_ptr<TemplateParameter> formal() const;

    /// <summary>
    /// formal setter
    /// The formal TemplateParameter that is associated with this
    /// TemplateParameterSubstitution.
    /// </summary>
    void setFormal(shared_ptr<TemplateParameter> value);

    /// <summary>
    /// ownedActual getter
    /// The ParameterableElement that is owned by this TemplateParameterSubstitution as
    /// its actual parameter.
    /// </summary>
    shared_ptr<ParameterableElement> ownedActual() const;

    /// <summary>
    /// ownedActual setter
    /// The ParameterableElement that is owned by this TemplateParameterSubstitution as
    /// its actual parameter.
    /// </summary>
    void setOwnedActual(shared_ptr<ParameterableElement> value);

    /// <summary>
    /// templateBinding getter
    /// The TemplateBinding that owns this TemplateParameterSubstitution.
    /// </summary>
    shared_ptr<TemplateBinding> templateBinding() const;

    /// <summary>
    /// templateBinding setter
    /// The TemplateBinding that owns this TemplateParameterSubstitution.
    /// </summary>
    void setTemplateBinding(shared_ptr<TemplateBinding> value);

private: // Fields
    /// <summary>
    /// actual
    /// The ParameterableElement that is the actual parameter for this
    /// TemplateParameterSubstitution.
    /// </summary>
    shared_ptr<ParameterableElement> actual_;

    /// <summary>
    /// formal
    /// The formal TemplateParameter that is associated with this
    /// TemplateParameterSubstitution.
    /// </summary>
    shared_ptr<TemplateParameter> formal_;

    /// <summary>
    /// ownedActual
    /// The ParameterableElement that is owned by this TemplateParameterSubstitution as
    /// its actual parameter.
    /// </summary>
    shared_ptr<ParameterableElement> ownedActual_;

    /// <summary>
    /// templateBinding
    /// The TemplateBinding that owns this TemplateParameterSubstitution.
    /// </summary>
    shared_ptr<TemplateBinding> templateBinding_;

};

} // namespace uml
